#include <iostream>
#include <cstring>

using namespace std;

const int N = 110;

int f[N];
int a[N];
int n;

int main()
{
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> a[i];
	memset(f, 0x3f, sizeof f);
	f[1] = 0;
	for(int i = 1; i <= n; i++)
	{
		for(int j = 1; j < i; j++)
		{
			if(i - j <= a[j]) f[i] = min(f[i], f[j] + 1);	
		}
	}
	cout << f[n] << endl;
	return 0;
}
